package com.biz.primus.model.misc.vo;


import com.biz.primus.model.misc.enums.ApiExceptionType;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 * 调用发送接口后供应商的响应
 *
 * @author yanweijin
 * @date 2017/5/31
 */
@Getter
@Setter
@NoArgsConstructor
public class ProviderResponse implements Serializable {


    private static final long serialVersionUID = -679013319474039710L;
    private boolean success = true;

    //如果成功,应该有一个用于查询送达状态的标志字段
    private String taskId;

    //如果失败,应该有失败原因
    private ApiExceptionType apiExceptionType;


    //展示供应商原始的返回信息
    private String originalMessage;

    public ProviderResponse(String taskId) {
        this.taskId = taskId;
        this.apiExceptionType = ApiExceptionType.SUCCESS;
        this.success = true;
    }

    public ProviderResponse(ApiExceptionType apiExceptionType, String originalMessage) {
        this.apiExceptionType = apiExceptionType;
        this.originalMessage = originalMessage;
        this.success = false;
    }

}
